﻿<%@ Page Language="C#" AutoEventWireup="true" Debug="true" ValidateRequest="false"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>방송통신대학원 웹프로그래밍특론 Google 시각화 API</title>

    <script type='text/javascript' src='http://www.google.com/jsapi'></script>

    <script language="javascript" type="text/javascript">
        function FileUpload()
        {
   
		        var filePath      = document.getElementById("<%= fileUp.ClientID %>").value;
		        
		        if(filePath == "")
		        {
		            alert('업로드할 파일을 선택하세요');
		            return false;
		        }
		        var fileExt       = filePath.substr(filePath.lastIndexOf(".")+1, filePath.length);

		        if (fileExt.toLowerCase() != "txt") {
		            alert('txt 파일만 업로드 가능합니다.'); 
		            return false;
		        }
		        return true;
        }
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table  border="0">
                <tr>
                    <td colspan="2">
                        <a href="Sample/Map.txt">GeoMap샘플파일</a>(GeoMap은 유효한 나라를 가져야 하므로 이 파일에서만 표시 가능합니다.)
                        <br />
                        <a href="Sample/Table.txt">테이블샘플파일</a>,
                        <a href="Sample/AreaChart.txt">AreaChart샘플파일</a>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:FileUpload ID="fileUp" runat="server" />
                        <asp:Button ID="btnUpload" Text="파일업로드&실행" OnClientClick="return FileUpload();" runat="server"
                            OnClick="btnUpload_Click" />
                    </td>
                </tr>
                <tr>
                    <td>테이블</td>
                    <td>Area Chart</td>
                </tr>
                <tr >
                    <td>
                        <div id='display_table' style="width: 400px; height: 300px">
                        </div>
                    </td>
                     <td>
                        <div id='display_chart' style="width: 400px; height: 300px">
                        </div>
                    </td>
                </tr>
               
               <tr >
                   
                </tr>
                <tr>
                    <td colspan="2">GeoMap</td>
                </tr>
                <tr >
                    <td colspan="2">
                        <div id='display_map' style="width: 400px; height: 300px">
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
